@ var head ={
<title>资源管理</title>
@};var ctrls= "ng-controller='ResCtrls'" ;  var body={

@if( so.hasPermission("/system/res/add")) {
  <div  ng-model="so_add" ng-init="so_add=true"></div>
@}if( so.hasPermission("/system/res/edit")) {
  <div  ng-model="so_edit" ng-init="so_edit=true"></div>
  @}if( so.hasPermission("/system/res/delete")) {
  <div  ng-model="so_delete" ng-init="so_delete=true"></div>
@}

<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
			<table id="treeGrid"></table>
		</div>
	</div>
	<div id="toolbar" style="display: none;">
	   <a ng-show="so_add" ng-click="addFun();" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'pencil_add'">添加</a>
		<a onclick="tgredo(treeGrid);" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'resultset_next'">展开</a>
		 <a onclick="tgundo(treeGrid);" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'resultset_previous'">折叠</a> 
		 <a onclick="treeGrid.treegrid('reload');" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'transmit'">刷新</a>
	</div>

	<div id="menu" class="easyui-menu" style="width: 120px; display: none;">
	        <div ng-show="so_add" ng-click="addFun();" data-options="iconCls:'pencil_add'">增加</div>
			<div ng-show="so_delete" ng-click="deleteFun();" data-options="iconCls:'pencil_delete'">删除</div>
			<div  ng-show="so_edit" ng-click="editFun();" data-options="iconCls:'pencil'">编辑</div>
	</div>
	
	<!--  dialog -->
	 <div id="dlg"   class="easyui-dialog" style=" width:540px;height:350px;padding:5px 10px" closed="true" buttons="#dlg-buttons"  data-options="resizable:true,modal:true">
	
	<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
		<form id="fm" method="post">
			<input name="res.id" type="hidden"   class="span2" value="" > 
			<table class="table table-hover table-condensed">
				<tr>
				<th>资源名称</th>
				<td colspan="4"><input name="res.name" type="text" placeholder="请输入资源名称" class="easyui-validatebox span2" data-options="required:true" value=""></td>
				</tr>
				<tr>
					<th>资源路径</th>
					<td><input name="res.url" type="text" placeholder="请输入资源路径" class="easyui-validatebox span2" value=""></td>
					<th>资源类型</th>
					<td><select name="res.type" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'" required="required">
					  <option value="1" >菜单
					  <option value="2">功能
					</select></td>
				</tr>
				<tr>
					<th>排序</th>
					<td><input name="res.seq" value="10" class="easyui-numberspinner" style="width: 140px; height: 29px;" required="required" data-options="editable:false,min:10"></td>
					<th>上级资源</th>
					<td><select id="pid" name="res.pid" style="width: 140px; height: 29px;"></select><img src="${CONTEXT_PATH}/static/js/ext/style/images/extjs_icons/cut_red.png" onclick="$('#pid').combotree('clear');" /></td>
				</tr>
				<tr>
					<th>菜单图标</th>
					<td colspan="3"><input id="iconCls" name="res.iconCls" style="width: 375px; height: 29px;"   /></td>
				</tr>
				<tr>
					<th>备注</th>
					<td colspan="3"><textarea id="des" name="res.des" rows="" cols="" class="span5"></textarea></td>
				</tr>
			</table>
		</form>
	   </div>
    </div>
  </div>
    <div id="dlg-buttons">
        <a href="javascript:void(0)" class="easyui-linkbutton"   ng-click="submit()">确定</a>
        <a href="javascript:void(0)" class="easyui-linkbutton"  onclick="javascript:$('#dlg').dialog('close')">取消</a>
    </div> 
 </div>   
@}; var js ={

<script type="text/javascript">

var formatterFun = function(value, row, index) {
	var str = '';
	@if( so.hasPermission("/system/res/edit")) 
	str += $.formatString('  <img onclick="$(this).scope().editFun(\'{0}\');" src="{1}" title="编辑"/>' , row.id, '${CONTEXT_PATH}/static/js/ext/style/images/extjs_icons/pencil.png');
     str += '&nbsp;';
     @if( so.hasPermission("/system/res/delete")) 
	str += $.formatString('  <img onclick="$(this).scope().deleteFun(\'{0}\');" src="{1}" title="删除"/> ', row.id, '${CONTEXT_PATH}/static/js/ext/style/images/extjs_icons/cancel.png');
    @
    return str;
}
	 
</script>
<script src="${CONTEXT_PATH}/static/app/ctrls/res-ctrls.js" type="text/javascript"></script>

@}; include("../layout/_layout.html",{head:head,body:body,js:js,ctrls:ctrls}){}    
	   
	
